﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Dcms.BLL;
using Dcms.Model;
using Dcms.Common;

public partial class guestbookcontrol : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Dcms_GuestBookBLL gBll = new Dcms_GuestBookBLL();
        Dcms_GuestBookModel gModel = new Dcms_GuestBookModel();
        gModel.GuestBook_AddTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"));
        gModel.GuestBook_Content = this.Content.Text;
        gModel.GuestBook_CateId = Utils.StrToInt(this.hid_ParentId.Value, 0);
        gModel.GuestBook_ReplyContent = "";
        gModel.GuestBook_ReplyTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"));
        gModel.GuestBook_State = "0";
        gModel.GuestBook_Title = this.Title.Text;
        gModel.GuestBook_UserEmail = this.UserEmail.Text;
        gModel.GuestBook_UserIM = this.UserIM.Text;
        gModel.GuestBook_UserIp = DcmsRequest.GetIP();
        gModel.GuestBook_UserName = this.UserName.Text;
        gModel.GuestBook_UserPic = "";
        gModel.GuestBook_UserTel = this.UserTel.Text;
        gBll.AddModel(gModel);
        Jscript.AlertAndBack("success,thank you!");
    }
}
